<?php
    session_start();	
	$email = $_POST["Email"];
	$password = $_POST["pass"];
	
	include("TableDataGateway/TDGLogin.php");
	$TDG = new TDGLogin();
	
	if($email != NULL){
		$logueado=$TDG->login($email, $password);
		
		if($logueado == false){
			$_SESSION['usuario'] = -5;
		}		
		header ("Location: index.php");
	}
?>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script>
<script type="text/javascript">
			/* Con las reglas en el metodo validate (no hacen falta los class="" en los input */
			$(document).ready(function(){		
				$("#form_datos").validate({
					rules: {
						 Email: {
						   required: true,
						   email: true
						 },
						 pass: "required"
					},
					messages: {
						 Email: "*",
						 pass: "*",
				   }
				});
			});
		  
</script>

<li id="submenu">
	<form id="form_datos" action="login.php" method="POST">
		<H2>Ingreso</H2>
		<H4>Correo Electr&oacute;nico</H4>
		<input type="text" id="Email" name="Email" size="25" class="required"/>
		<H4>Contrase&ntilde;a</H4>
		<input type="password" id="pass" name="pass" size="25" class="required"/><br/><br/>
		<input type="submit" value="Ingresar"/> <!--<input type="reset" value="Borrar"/>-->
	</form>
</li>